import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import 'tdesign-react/es/style/index.css'
import {BrowserRouter, Route, Routes} from 'react-router'
import QRLogin from './components/QRLogin.tsx'
import PhoneLogin from './components/PhoneLogin.tsx'
import ResetPassword from './components/ResetPassword.tsx'
import Start from './Start.tsx'
import Shortcut from './Shortcut.tsx'

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <BrowserRouter>

      <Routes>
        <Route element={<App/>}>
          <Route path="/" element={<QRLogin/>}/>
          <Route path="/account" element={<PhoneLogin/>}/>
          <Route path="/reset" element={<ResetPassword/>}/>
        </Route>

        <Route path="/start" element={<Start/>}></Route>
        <Route path="/shortcut" element={<Shortcut/>}></Route>
      </Routes>

    </BrowserRouter>
  </React.StrictMode>
)

// Use contextBridge
window.ipcRenderer.on('main-process-message', (_event, message) => {
  console.log(message)
})
